package com.example.hy2110szyx.service.impl;

import com.example.hy2110szyx.entity.Distribution;
import com.example.hy2110szyx.entity.FlightInfo;
import com.example.hy2110szyx.repository.DistributionMapper;
import com.example.hy2110szyx.service.DistributionService;
import com.example.hy2110szyx.vo.PageVo;
import com.github.pagehelper.Page;
import com.github.pagehelper.PageHelper;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class DistributionServiceImpl implements DistributionService {

    @Autowired
    private DistributionMapper distributionMapper;

    @Override
    public Distribution queryByFno(String fno) {
        return distributionMapper.queryByFno(fno);
    }

    /**
     * 分页查询航线
     * @param pageVo
     * @return
     */
    @Override
    public Page<Distribution> queryAllDisForPage(PageVo<Distribution> pageVo) {
        Page<Distribution> page = PageHelper.startPage(pageVo.getStart(), pageVo.getMax(),
                pageVo.getOrderBy() + " " + pageVo.getOrder());
        distributionMapper.queryAllConn(pageVo.getCondition());
        return page;
    }

    @Override
    public void insertOneDistribution(Distribution distribution) {

    }

    @Override
    public void updateOneDistribution(Distribution distribution) {
        distributionMapper.updateOneDistribution(distribution);

    }

    @Override
    public void deleteSomeById(Integer[] ids) {

    }
}
